const WebSocket = require('ws')
//new WebSocket类创建一个wss实例对象并开启服务监听端口7000
const wss = new WebSocket.Server({ port: 7000 })
wss.on('connection', function connection(ws) {
  ws.on('message', function incoming(message) {
    console.log('received: %s', message)
  })

  ws.send('somet')
})
